package com.wz.file;


public class QuickPayOrder {
	private int id;
	private String interface_number;
	private String interface_name;
	private String card_no;
	private int card_type;
	private int bank_id;
	private String mer_id;
	private String mer_account;
	private String oem_pay_orderid;
	private String pay_account;
	private int pay_amount;
	private int pay_user_id;
	private int curid;
	private int payed_value;
	private String pay_order_id;
	private String bank_order_id;
	private String add_time;
	private String end_time;
	private int pay_result;
	private String result_desc;
	private int installment_times;
	private String from_mob;
	private String from_ip;
	private String attach;
	private int cbstate;
	public QuickPayOrder(){}

//	int  cbstate = this.pay_result/1000==0?0:this.pay_result/1000; 
//	return  "\""+mer_id + "\",\""
//			+ oem_pay_orderid + "\",\"" + pay_order_id + "\",\""
//			+ bank_order_id + "\",\"" + bank_id + "\",\"" + add_time
//			+ "\",\"" + cbstate + "\",\"" + pay_amount + "\",\""
//			+ payed_value + "\",\"" + attach +"\"";
	public QuickPayOrder(String str){
		String[] s = str.split("\t");
		this.id = Integer.parseInt(s[0]);
		this.interface_number = s[1];
		this.interface_name = s[2];
		this.card_no = s[3];
		this.card_type = Integer.parseInt(s[4]);
		this.bank_id =Integer.parseInt(s[5]);
		this.mer_id = s[6];
		this.mer_account = s[7];
		this.oem_pay_orderid = s[8];
		this.pay_account = s[9];
		this.pay_amount = Integer.parseInt(s[10]);
		this.pay_user_id = Integer.parseInt(s[11]);
		this.curid = Integer.parseInt(s[12]);
		this.payed_value = Integer.parseInt(s[13]);
		this.pay_order_id = s[14];
		this.bank_order_id = s[15];
		this.add_time = s[16];
		this.end_time = s[17];
		this.pay_result = Integer.parseInt(s[18]);
		this.result_desc = s[19];
		this.installment_times = Integer.parseInt(s[20]);
		this.from_mob = s[21];
		this.from_ip = s[22];
		this.attach = s[23];
		this.cbstate = this.pay_result/1000==0?0:this.pay_result/1000;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getInterface_number() {
		return interface_number;
	}

	public void setInterface_number(String interface_number) {
		this.interface_number = interface_number;
	}

	public String getInterface_name() {
		return interface_name;
	}

	public void setInterface_name(String interface_name) {
		this.interface_name = interface_name;
	}

	public String getCard_no() {
		return card_no;
	}

	public void setCard_no(String card_no) {
		this.card_no = card_no;
	}

	public int getCard_type() {
		return card_type;
	}

	public void setCard_type(int card_type) {
		this.card_type = card_type;
	}

	public int getBank_id() {
		return bank_id;
	}

	public void setBank_id(int bank_id) {
		this.bank_id = bank_id;
	}

	public String getMer_id() {
		return mer_id;
	}

	public void setMer_id(String mer_id) {
		this.mer_id = mer_id;
	}

	public String getMer_account() {
		return mer_account;
	}

	public void setMer_account(String mer_account) {
		this.mer_account = mer_account;
	}

	public String getOem_pay_orderid() {
		return oem_pay_orderid;
	}

	public void setOem_pay_orderid(String oem_pay_orderid) {
		this.oem_pay_orderid = oem_pay_orderid;
	}

	public String getPay_account() {
		return pay_account;
	}

	public void setPay_account(String pay_account) {
		this.pay_account = pay_account;
	}

	public int getPay_amount() {
		return pay_amount;
	}

	public void setPay_amount(int pay_amount) {
		this.pay_amount = pay_amount;
	}

	public int getPay_user_id() {
		return pay_user_id;
	}

	public void setPay_user_id(int pay_user_id) {
		this.pay_user_id = pay_user_id;
	}

	public int getCurid() {
		return curid;
	}

	public void setCurid(int curid) {
		this.curid = curid;
	}

	public int getPayed_value() {
		return payed_value;
	}

	public void setPayed_value(int payed_value) {
		this.payed_value = payed_value;
	}

	public String getPay_order_id() {
		return pay_order_id;
	}

	public void setPay_order_id(String pay_order_id) {
		this.pay_order_id = pay_order_id;
	}

	public String getBank_order_id() {
		return bank_order_id;
	}

	public void setBank_order_id(String bank_order_id) {
		this.bank_order_id = bank_order_id;
	}

	public String getAdd_time() {
		return add_time;
	}

	public void setAdd_time(String add_time) {
		this.add_time = add_time;
	}

	public String getEnd_time() {
		return end_time;
	}

	public void setEnd_time(String end_time) {
		this.end_time = end_time;
	}

	public int getPay_result() {
		return pay_result;
	}

	public void setPay_result(int pay_result) {
		this.pay_result = pay_result;
	}

	public String getResult_desc() {
		return result_desc;
	}

	public void setResult_desc(String result_desc) {
		this.result_desc = result_desc;
	}

	public int getInstallment_times() {
		return installment_times;
	}

	public void setInstallment_times(int installment_times) {
		this.installment_times = installment_times;
	}

	public String getFrom_mob() {
		return from_mob;
	}

	public void setFrom_mob(String from_mob) {
		this.from_mob = from_mob;
	}

	public String getFrom_ip() {
		return from_ip;
	}

	public void setFrom_ip(String from_ip) {
		this.from_ip = from_ip;
	}

	public String getAttach() {
		return attach;
	}

	public void setAttach(String attach) {
		this.attach = attach;
	}
	public int getCbstate() {
		return cbstate;
	}

	public void setCbstate(int cbstate) {
		this.cbstate = cbstate;
	}

	@Override
	public String toString() {
		return  "\""+mer_id + "\",\""
				+ oem_pay_orderid + "\",\"" + pay_order_id + "\",\""
				+ bank_order_id + "\",\"" + bank_id + "\",\"" + getTime(add_time)
				+ "\",\"" + this.cbstate + "\",\"" + pay_amount + "\",\""
				+ payed_value + "\",\"" + attach +"\"";
	}
//2012-12-20 16:39:08.0
	public static String getTime(String time){
		if (!"".equals(time.trim())){
			return time.substring(0, 19);
		}
		return "";
	}
}